package com.onpositive.data.diskstorage;

import java.io.File;
import java.util.HashMap;

import com.onpositive.data.IPropertyConstants;
import com.onpositive.data.IPropertyMetadata;

public abstract class TwoPartsCollection extends SplittedCollection {

	private File cmp;

	HashMap<IPropertyMetadata, ReaderInfo> ms = new HashMap<IPropertyMetadata, SplittedCollection.ReaderInfo>();

	public TwoPartsCollection(int dataSize, File cmp) {
		super(dataSize);
		this.cmp = cmp;
	}

	@Override
	protected ReaderInfo getAccess(IPropertyMetadata meta) {
		if (meta.id().equals(
				IPropertyConstants.MAIN_PICTURE_PROPERTY_METADATA_ID)) {
			ReaderInfo mm = new ReaderInfo(0, 0, 0, null);
		}
		if (meta.id().equals(IPropertyConstants.TEXT_CONTENT_PROPERTY_NAME)) {
			ReaderInfo mm = new ReaderInfo(0, 0, 0, null);
		}
		if (!cmp.exists()) {
			cmp=download();
		}
		return ms.get(meta);
	}

	protected abstract File download() ;

}
